<?php

namespace App\Http\Queries;

use App\Models\UserDraw;
use Spatie\QueryBuilder\QueryBuilder;
use Spatie\QueryBuilder\AllowedFilter;

class UserDrawQuery extends QueryBuilder
{
    public function __construct()
    {
        parent::__construct(UserDraw::query());
        $this->allowedIncludes('activity');
        $this->allowedFilters([
            AllowedFilter::exact('user_id'),
            AllowedFilter::exact('activity_id'),
            AllowedFilter::scope('win'),
            AllowedFilter::exact('customer_info_id'),
        ]);
        $this->defaultSort('-id');
    }
}
